function request(parms) {
  wx.showLoading({
    title: '正在加载中',

  })
  return new Promise((resolve, reject) => {
    wx.request({
      ...parms,
      success: (res) => {
        resolve(res.data);
      },
      fail: (err) => {
        reject(err);
      },
      complete: () => {
        setTimeout(() => {
          wx.hideLoading({});
        }, 1000);
      }
    })
  })

}

export default request;